#!/bin/sh -e

export DESTDIR="$1"

cl-meson \
    . output

ninja -C output
ninja -C output install

# Install xclip wrapper.
clinst -Dm755 xclip/src/wl-clipboard-x11 "$1/usr/bin/xclip"
ln -s xclip "$1/usr/bin/xsel"

# Install manual page for the xclip wrapper
clman xclip/man/wl-clipboard-x11.1
ln -s wl-clipboard-x11.1 "$1/usr/share/man/man1/xclip.1"
ln -s wl-clipboard-x11.1 "$1/usr/share/man/man1/xsel.1"
